package com.jbm.onehome.iface;

import javax.persistence.*;
import com.jbm.core.iface.IAcross;
import java.sql.Timestamp;

/**
 * Created by lyh on 2017-03-14.
 */
@Entity
@Table(name = "exchange", schema = "", catalog = "")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
public class ExchangeEntity extends IAcross
{
	public ExchangeEntity()
	{
		super();
	}

	public ExchangeEntity(IAcross ia)
	{
		super(ia);
	}

    private static final long serialVersionUID = 908895120424099562L;
    private int ecId;
    private Integer loginId;
    private Integer points;
    private Integer ecType;
    private Timestamp createDate;
    private Integer targetId;
    private Integer expId;
    public   ExchangeEntity(String method,Integer loginId,Integer expId,Integer ecType){
        this.method=method;
        this.loginId=loginId;
        this.expId=expId;
        this.ecType= ecType;
    }

    @Id
    @Column(name = "ec_id")
    @GeneratedValue
    public int getEcId() {
        return ecId;
    }

    public void setEcId(int ecId) {
        this.ecId = ecId;
    }

    @Basic
    @Column(name = "login_id")
    public Integer getLoginId() {
        return loginId;
    }

    public void setLoginId(Integer loginId) {
        this.loginId = loginId;
    }

    @Basic
    @Column(name = "points")
    public Integer getPoints() {
        return points;
    }

    public void setPoints(Integer points) {
        this.points = points;
    }

    @Basic
    @Column(name = "ec_type")
    public Integer getEcType() {
        return ecType;
    }

    public void setEcType(Integer ecType) {
        this.ecType = ecType;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "target_id")
    public Integer getTargetId() {
        return targetId;
    }

    public void setTargetId(Integer targetId) {
        this.targetId = targetId;
    }
    @Basic
    @Column(name = "exp_id")
    public Integer getExpId() {
        return expId;
    }

    public void setExpId(Integer expId) {
        this.expId = expId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ExchangeEntity that = (ExchangeEntity) o;

        if (ecId != that.ecId) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (ecType != null ? !ecType.equals(that.ecType) : that.ecType != null) return false;
        if (loginId != null ? !loginId.equals(that.loginId) : that.loginId != null) return false;
        if (points != null ? !points.equals(that.points) : that.points != null) return false;
        if (targetId != null ? !targetId.equals(that.targetId) : that.targetId != null) return false;
        if (expId != null ? !expId.equals(that.expId) : that.expId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = ecId;
        result = 31 * result + (loginId != null ? loginId.hashCode() : 0);
        result = 31 * result + (points != null ? points.hashCode() : 0);
        result = 31 * result + (ecType != null ? ecType.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (targetId != null ? targetId.hashCode() : 0);
        result = 31 * result + (expId != null ? expId.hashCode() : 0);
        return result;
    }

    @Transient
    public boolean back;
    @Transient
    public String method;
    @Transient
    public String errorinfo;
    @Transient
    public int count;
    @Transient
    public int start=0;
    @Transient
    public int pagesize=0;
    @Transient
    public Integer tableid;
}
